﻿
/*========================================================================================
// -- 
//创建者: goodasong
//创建时间：2011年9月23日 星期五
//类描述：实体类 TOUTTTUser (属性说明自动提取数据库字段的描述信息)
//最后修改者:goodasong
//最后修改时间:2011年9月23日 星期五	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.Rights.Model
{
    /// <summary>
    /// 实体类 TOUTTTUser (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "TOUTTTUser", PrimaryKey = "GID", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class TOUTTTUserInfo : BaseModel
    {
        public TOUTTTUserInfo()
        {            
            PrimaryKey = "GID"; 
			Fields.Add("ID");//标识
			Fields.Add("GID");//主键
			Fields.Add("TOU_GID");//组织主键
			Fields.Add("TUser_GID");//用户主键
			
			
			
			CanNotNullFields.Add("GID");//主键不能为空!				
			
			CanNotNullFields.Add("TOU_GID");//组织主键不能为空!				
			
			CanNotNullFields.Add("TUser_GID");//用户主键不能为空!				
			this.OnCreated();			
			this.OnModelCreated();
        }
		public TOUTTTUserInfo(bool isNewInfo)
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
            GID = Guid.NewGuid().ToString();
        }
        #endregion 
		
		#region 成员变量
				
		private int? _ID;//标识
		private string _GID;//主键
		private string _TOU_GID;//组织主键
		private string _TUser_GID;//用户主键
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// 标识
        /// </summary>       
		[ModelField(Description = "标识", Type = typeof(int?), ErrorMessage = "标识信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 4,  DbType = "int", IsNeedRecordModify = true)]
        public virtual int? ID
        {
            get
            {
                return this._ID;
            }
            set
            {
				_ID = value;
            }
        }
		
		/// <summary>
        /// 主键
        /// </summary>       
		[ModelField(Description = "主键", Type = typeof(string), ErrorMessage = "主键信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 36,  DbType = "char", IsNeedRecordModify = true)]
        public virtual string GID
        {
            get
            {
                return this._GID;
            }
            set
            {
                if (_GID != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TOUTTTUser", "GID", _GID, value, "char", "主键");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnGIDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._GID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnGIDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _GID = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 组织主键
        /// </summary>       
		[ModelField(Description = "组织主键", Type = typeof(string), ErrorMessage = "组织主键信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 36,  DbType = "char", IsNeedRecordModify = true)]
        public virtual string TOU_GID
        {
            get
            {
                return this._TOU_GID;
            }
            set
            {
                if (_TOU_GID != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TOUTTTUser", "TOU_GID", _TOU_GID, value, "char", "组织主键");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnTOU_GIDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._TOU_GID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnTOU_GIDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _TOU_GID = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 用户主键
        /// </summary>       
		[ModelField(Description = "用户主键", Type = typeof(string), ErrorMessage = "用户主键信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 36,  DbType = "char", IsNeedRecordModify = true)]
        public virtual string TUser_GID
        {
            get
            {
                return this._TUser_GID;
            }
            set
            {
                if (_TUser_GID != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TOUTTTUser", "TUser_GID", _TUser_GID, value, "char", "用户主键");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnTUser_GIDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._TUser_GID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnTUser_GIDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _TUser_GID = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnIDChanging(ModifyInfo modifyInfo);//标识ID改变之前发生
        partial void OnIDChanged(ModifyInfo modifyInfo);//标识ID改变之后发生
		partial void OnGIDChanging(ModifyInfo modifyInfo);//主键GID改变之前发生
        partial void OnGIDChanged(ModifyInfo modifyInfo);//主键GID改变之后发生
		partial void OnTOU_GIDChanging(ModifyInfo modifyInfo);//组织主键TOU_GID改变之前发生
        partial void OnTOU_GIDChanged(ModifyInfo modifyInfo);//组织主键TOU_GID改变之后发生
		partial void OnTUser_GIDChanging(ModifyInfo modifyInfo);//用户主键TUser_GID改变之前发生
        partial void OnTUser_GIDChanged(ModifyInfo modifyInfo);//用户主键TUser_GID改变之后发生
		
		#endregion		
		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("TOUTTTUser", "GID", GID);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("TOUTTTUser", "GID", GID);		
			ManageEditURI = ZModel.InitMEditURI("TOUTTTUser", "GID", GID);	
		 	ManageDetailURI = ZModel.InitMDetailURI("TOUTTTUser", "GID", GID);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}